library(ggplot2)
library(rlang)
library(sf)
library(dplyr)
library(mgcv)
library(purrr)
library(broom)
library(modelr)
library(tidyr)
library(lazyeval)
library(lme4)
library(here)
Load the data.
# Get 48-day window, bicubic interpolation data
# cbi <- st_read(here::here("data/ee_cbi-calibration/cbi-calibration_48-day-window_L57_bicubic-interp_texture.geojson"), stringsAsFactors = FALSE)
cbi <- st_read(here::here("data/ee_cbi-calibration/cbi-calibration_48-day-window_L57_bicubic-interp_texture_10000.geojson"), stringsAsFactors = FALSE)
## Reading layer `cbi-calibration_48-day-window_L57_bicubic-interp_texture_10000' from data source `/Users/mikoontz/dev/manuscripts/remote-sensing-resistance/data/ee_cbi-calibration/cbi-calibration_48-day-window_L57_bicubic-interp_texture_10000.geojson' using driver `GeoJSON'
## Simple feature collection with 401 features and 141 fields
## geometry type: POINT
## dimension: XY
## bbox: xmin: -119.7917 ymin: 35.55484 xmax: -117.9751 ymax: 37.88774
## epsg (SRID): 4326
## proj4string: +proj=longlat +datum=WGS84 +no_defs
glimpse(cbi)
## Observations: 401
## Variables: 142
## $ B1_post <dbl> 215.0, 282.5, 226.0, 257.0, 317.0, 271.5, 28...
## $ B1_pre <dbl> 195.0, 203.5, 197.0, 217.0, 283.0, 255.0, 27...
## $ B2_post <dbl> 297.0, 351.5, 284.0, 304.0, 415.0, 405.0, 37...
## $ B2_pre <dbl> 241.0, 284.0, 247.0, 306.0, 402.0, 354.0, 35...
## $ B3_post <dbl> 212.0, 285.5, 231.0, 296.0, 423.0, 372.5, 32...
## $ B3_pre <dbl> 193.0, 233.5, 200.0, 237.0, 335.0, 286.0, 29...
## $ B4_post <dbl> 1262.0, 1617.5, 1268.0, 1247.0, 1548.0, 1697...
## $ B4_pre <dbl> 1328.0, 1596.5, 1180.0, 1363.0, 2007.0, 1870...
## $ B5_post <dbl> 436.5, 513.0, 504.0, 519.0, 1298.0, 1038.5, ...
## $ B5_pre <dbl> 414, 382, 377, 472, 1011, 861, 816, 1317, 61...
## $ B6_post <dbl> 2936.0, 2899.5, 2924.0, 2924.0, 2948.0, 2956...
## $ B6_pre <dbl> 2929, 2897, 2924, 2928, 2944, 2954, 2945, 29...
## $ B7_post <dbl> 202.0, 229.0, 249.0, 318.0, 917.0, 581.0, 35...
## $ B7_pre <dbl> 193.0, 168.5, 211.0, 218.0, 474.0, 384.0, 32...
## $ RBR <dbl> -0.002682218, 0.030460158, 0.013376400, 0.05...
## $ RdNBR <dbl> -0.1716939, 1.9396591, 0.8603629, 3.8149382,...
## $ RdNBR2 <dbl> -0.4438418, 1.5564183, 1.9793594, 3.7753341,...
## $ RdNDVI <dbl> 0.3914104, 1.5818284, 0.1691869, 3.9971833, ...
## $ alarm_date <dbl> 1.033456e+12, 1.033456e+12, 1.033456e+12, 1....
## $ aspect <dbl> 348, 277, 316, 300, 281, 271, 301, 249, 271,...
## $ cbi_over <dbl> 0.68, 0.83, 0.43, 0.81, 1.36, 1.14, 0.00, 0....
## $ conifer_forest <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,...
## $ dNBR <dbl> -0.004665017, 0.054834127, 0.022708058, 0.10...
## $ dNBR2 <dbl> -0.008519232, 0.030652344, 0.037714839, 0.07...
## $ dNDVI <dbl> 0.010588050, 0.043275297, 0.004431367, 0.107...
## $ date <dbl> 1.033456e+12, 1.033456e+12, 1.033456e+12, 1....
## $ elev <dbl> 1820, 2213, 1859, 1836, 1730, 1663, 1625, 17...
## $ erc <dbl> 77.30512, 77.30512, 77.30512, 77.30512, 77.3...
## $ fire_name <chr> "Tar Gap", "Tar Gap", "Tar Gap", "Tar Gap", ...
## $ fm100 <dbl> 8.361945, 8.361945, 8.361945, 8.361945, 8.36...
## $ focal_mean_ndvi_1 <dbl> 0.7391083, 0.7476245, 0.7081314, 0.7271785, ...
## $ focal_mean_ndvi_2 <dbl> 0.7319798, 0.7385244, 0.6994438, 0.7152680, ...
## $ focal_mean_ndvi_3 <dbl> 0.7289782, 0.7298161, 0.6867761, 0.7073652, ...
## $ focal_mean_ndvi_4 <dbl> 0.7266133, 0.7229491, 0.6776735, 0.6997653, ...
## $ focal_mean_ndwi_1 <dbl> 0.51006836, 0.58825886, 0.48948634, 0.496608...
## $ focal_mean_ndwi_2 <dbl> 0.504876077, 0.556651711, 0.469665229, 0.488...
## $ focal_mean_ndwi_3 <dbl> 0.50197190, 0.54521978, 0.43893343, 0.486392...
## $ focal_mean_ndwi_4 <dbl> 0.49483317, 0.54334849, 0.41790974, 0.476846...
## $ het_ndvi_1 <dbl> 0.01340721, 0.01242966, 0.02791420, 0.013599...
## $ het_ndvi_2 <dbl> 0.01923984, 0.02558582, 0.02315903, 0.020045...
## $ het_ndvi_3 <dbl> 0.01920577, 0.02806748, 0.04246271, 0.021895...
## $ het_ndvi_4 <dbl> 0.02099955, 0.02860249, 0.04813308, 0.023038...
## $ het_ndwi_1 <dbl> 0.01846665, 0.03222465, 0.04114682, 0.025296...
## $ het_ndwi_2 <dbl> 0.02863191, 0.05659262, 0.05815271, 0.034322...
## $ het_ndwi_3 <dbl> 0.03335767, 0.05707246, 0.10299358, 0.037274...
## $ het_ndwi_4 <dbl> 0.03653562, 0.06203364, 0.12762485, 0.049353...
## $ id <chr> "44", "62", "59", "56", "45", "51", "61", "4...
## $ lat <dbl> 36.43769, 36.43365, 36.44200, 36.44119, 36.4...
## $ lon <dbl> -118.6815, -118.6740, -118.6772, -118.6788, ...
## $ nd_asm_1 <dbl> 0.1041667, 0.1111111, 0.1041667, 0.1041667, ...
## $ nd_asm_2 <dbl> 0.02812500, 0.02875000, 0.02843750, 0.028125...
## $ nd_asm_3 <dbl> 0.01296769, 0.01303855, 0.01296769, 0.013038...
## $ nd_asm_4 <dbl> 0.007450810, 0.007426698, 0.007474923, 0.007...
## $ nd_contrast_1 <dbl> 8491.438, 5689.771, 70183.188, 12160.375, 35...
## $ nd_contrast_2 <dbl> 13641.66, 26463.62, 47355.97, 23384.22, 1996...
## $ nd_contrast_3 <dbl> 24407.44, 45203.78, 107620.35, 33650.67, 232...
## $ nd_contrast_4 <dbl> 24726.86, 43563.72, 99889.72, 32847.31, 2685...
## $ nd_corr_1 <dbl> 0.075471429, 0.121018095, -0.069691756, -0.1...
## $ nd_corr_2 <dbl> 0.21807878, 0.24009794, 0.08789586, 0.453951...
## $ nd_corr_3 <dbl> 0.2569587, 0.4024208, 0.2576734, 0.4029412, ...
## $ nd_corr_4 <dbl> 0.4495723, 0.5805941, 0.6451412, 0.3335307, ...
## $ nd_dent_1 <dbl> 1.589027, 1.531265, 1.589027, 1.589027, 1.58...
## $ nd_dent_2 <dbl> 2.793674, 2.793674, 2.827842, 2.849503, 2.82...
## $ nd_dent_3 <dbl> 3.574443, 3.541436, 3.608333, 3.558823, 3.58...
## $ nd_dent_4 <dbl> 4.024154, 4.073469, 4.116691, 4.065535, 4.03...
## $ nd_diss_1 <dbl> 77.27083, 62.39583, 219.31250, 91.00000, 51....
## $ nd_diss_2 <dbl> 93.88125, 118.62500, 166.90312, 121.09687, 1...
## $ nd_diss_3 <dbl> 122.9841, 156.9514, 237.1508, 138.4444, 117....
## $ nd_diss_4 <dbl> 124.4010, 160.2912, 231.3125, 139.9857, 127....
## $ nd_dvar_1 <dbl> 1260.9913, 1424.8316, 20987.4844, 3811.7361,...
## $ nd_dvar_2 <dbl> 4626.474, 12210.214, 19142.545, 8421.569, 83...
## $ nd_dvar_3 <dbl> 9138.790, 20133.564, 48939.323, 14020.685, 9...
## $ nd_dvar_4 <dbl> 9105.559, 17413.017, 44057.705, 12693.352, 1...
## $ nd_ent_1 <dbl> 2.282174, 2.224412, 2.282174, 2.282174, 2.28...
## $ nd_ent_2 <dbl> 3.577308, 3.559979, 3.568643, 3.577308, 3.56...
## $ nd_ent_3 <dbl> 4.349616, 4.345490, 4.349616, 4.345490, 4.34...
## $ nd_ent_4 <dbl> 4.903701, 4.906108, 4.901295, 4.903401, 4.90...
## $ nd_idm_1 <dbl> 1.407776e-02, 2.016196e-03, 5.915513e-04, 6....
## $ nd_idm_2 <dbl> 5.121877e-03, 7.554094e-03, 3.021732e-02, 9....
## $ nd_idm_3 <dbl> 0.0137156702, 0.0080193388, 0.0151620323, 0....
## $ nd_idm_4 <dbl> 0.0130482565, 0.0063919255, 0.0136538928, 0....
## $ nd_imcorr1_1 <dbl> -0.8735072, -0.8688790, -0.8735072, -0.87350...
## $ nd_imcorr1_2 <dbl> -0.8481619, -0.8308430, -0.8352688, -0.85459...
## $ nd_imcorr1_3 <dbl> -0.8210226, -0.8447527, -0.8519694, -0.85719...
## $ nd_imcorr1_4 <dbl> -0.8212366, -0.8511262, -0.8552938, -0.86137...
## $ nd_imcorr2_1 <dbl> 0.9851321, 0.9830549, 0.9851321, 0.9851321, ...
## $ nd_imcorr2_2 <dbl> 0.9973994, 0.9968099, 0.9969905, 0.9975857, ...
## $ nd_imcorr2_3 <dbl> 0.9988249, 0.9991292, 0.9992130, 0.9992610, ...
## $ nd_imcorr2_4 <dbl> 0.9994603, 0.9996513, 0.9996700, 0.9996997, ...
## $ nd_inertia_1 <dbl> 8491.438, 5689.771, 70183.188, 12160.375, 35...
## $ nd_inertia_2 <dbl> 13641.66, 26463.62, 47355.97, 23384.22, 1996...
## $ nd_inertia_3 <dbl> 24407.44, 45203.78, 107620.35, 33650.67, 232...
## $ nd_inertia_4 <dbl> 24726.86, 43563.72, 99889.72, 32847.31, 2685...
## $ nd_maxcorr_1 <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
## $ nd_maxcorr_2 <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
## $ nd_maxcorr_3 <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
## $ nd_maxcorr_4 <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
## $ nd_prom_1 <dbl> 1.853195e+08, 9.805328e+07, 7.717588e+09, 2....
## $ nd_prom_2 <dbl> 1.289772e+09, 1.015144e+10, 7.689784e+09, 1....
## $ nd_prom_3 <dbl> 4.504307e+09, 3.204376e+10, 2.126978e+11, 1....
## $ nd_prom_4 <dbl> 1.229902e+10, 5.517280e+10, 1.039643e+12, 1....
## $ nd_savg_1 <dbl> 14731.229, 15059.812, 14215.562, 14478.333, ...
## $ nd_savg_2 <dbl> 14656.287, 14942.138, 14202.697, 14373.359, ...
## $ nd_savg_3 <dbl> 14593.290, 14762.378, 14008.744, 14264.119, ...
## $ nd_savg_4 <dbl> 14537.874, 14643.946, 13820.163, 14215.461, ...
## $ nd_sent_1 <dbl> 1.589027, 1.531265, 1.589027, 1.589027, 1.58...
## $ nd_sent_2 <dbl> 2.849503, 2.845171, 2.884160, 2.884160, 2.86...
## $ nd_sent_3 <dbl> 3.626212, 3.616585, 3.650967, 3.617960, 3.63...
## $ nd_sent_4 <dbl> 4.157606, 4.166017, 4.197317, 4.177461, 4.19...
## $ nd_shade_1 <dbl> 228237.48, -122436.70, 4651864.51, -22931.38...
## $ nd_shade_2 <dbl> -1754307, -14717938, 5164245, -5785000, -275...
## $ nd_shade_3 <dbl> -3624729.7, -30605413.3, -115564267.2, -8461...
## $ nd_shade_4 <dbl> -2662279, -26708850, -456997065, -2166811, -...
## $ nd_svar_1 <dbl> 9407.220, 6761.283, 55264.325, 10205.764, 33...
## $ nd_svar_2 <dbl> 21699.84, 46625.09, 55859.53, 65828.48, 2568...
## $ nd_svar_3 <dbl> 42227.53, 108065.14, 197795.79, 79653.84, 39...
## $ nd_svar_4 <dbl> 65596.17, 166892.68, 480033.42, 65075.14, 51...
## $ nd_var_1 <dbl> 4474.664, 3112.763, 31361.878, 5591.535, 172...
## $ nd_var_2 <dbl> 8835.375, 18272.177, 25803.874, 22303.176, 1...
## $ nd_var_3 <dbl> 16658.74, 38317.23, 76354.03, 28326.13, 1558...
## $ nd_var_4 <dbl> 22580.76, 52614.10, 144980.79, 24480.61, 195...
## $ ordinal_day <dbl> 273, 273, 273, 273, 273, 273, 273, 273, 151,...
## $ postFire_nbr <dbl> 0.74290389, 0.74435771, 0.67391306, 0.625199...
## $ postFire_nbr2 <dbl> 0.376940280, 0.357207417, 0.325342476, 0.295...
## $ postFire_ndvi <dbl> 0.7211694, 0.7051722, 0.6815969, 0.6130719, ...
## $ postFire_ndwi <dbl> 0.50318885, 0.52097470, 0.43760219, 0.407872...
## $ pr <dbl> 0.000000, 0.000000, 0.000000, 0.000000, 0.00...
## $ preFire_nbr <dbl> 0.7382389, 0.7991918, 0.6966211, 0.7281421, ...
## $ preFire_nbr2 <dbl> 0.3684210, 0.3878598, 0.3630573, 0.3681159, ...
## $ preFire_ndvi <dbl> 0.7317575, 0.7484475, 0.6860282, 0.7203540, ...
## $ preFire_ndwi <dbl> 0.524684250, 0.603657365, 0.483425409, 0.491...
## $ slope <dbl> 23, 15, 24, 24, 24, 17, 27, 20, 16, 11, 13, ...
## $ source <chr> "zhu2006", "zhu2006", "zhu2006", "zhu2006", ...
## $ tmmx <dbl> 744.9651, 744.9651, 744.9651, 744.9651, 744....
## $ topo_roughness_1 <dbl> 11.2354072, 5.8616870, 11.1775445, 10.222524...
## $ topo_roughness_2 <dbl> 20.686105, 12.641903, 18.025012, 18.438901, ...
## $ topo_roughness_3 <dbl> 29.649222, 18.524746, 23.729231, 25.790792, ...
## $ topo_roughness_4 <dbl> 37.452094, 24.888049, 29.045414, 33.850766, ...
## $ cbi_over_t <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ...
## $ cbi_tot <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ...
## $ cbi_tot_t <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ...
## $ geometry <POINT [°]> POINT (-118.6815 36.43765), POINT (-11...
Some exploratory plots using a few predictors.
Our original metric. Tells us about the spread of the distribution of NDVI on the same scale as that of the NDVI data
hetNDVI <- cbi %>%
select(starts_with("het_ndvi"), cbi_over, id, RBR) %>%
gather(key = radius, value = heterogeneity, starts_with("het_ndvi")) %>%
separate(col = radius, into = c("type", "vi", "radius")) %>%
tidyr::unite(het_type, type, vi, sep = "_")
ggplot(hetNDVI, aes(x = heterogeneity)) +
geom_density() +
facet_wrap( ~ as.factor(radius))
## Warning: Removed 32 rows containing non-finite values (stat_density).
ggplot(hetNDVI, aes(x = heterogeneity, y = cbi_over)) +
geom_point() +
geom_smooth(method = "lm") +
facet_wrap( ~ as.factor(radius))
## Warning: Removed 184 rows containing non-finite values (stat_smooth).
## Warning: Removed 184 rows containing missing values (geom_point).
hetNDWI <- cbi %>%
select(starts_with("het_ndwi"), cbi_over, id, RBR) %>%
gather(key = radius, value = heterogeneity, starts_with("het_ndwi")) %>%
separate(col = radius, into = c("type", "vi", "radius")) %>%
tidyr::unite(het_type, type, vi, sep = "_")
ggplot(hetNDWI, aes(x = heterogeneity)) +
geom_density() +
facet_wrap( ~ as.factor(radius))
## Warning: Removed 32 rows containing non-finite values (stat_density).
ggplot(hetNDWI, aes(x = heterogeneity, y = cbi_over)) +
geom_point() +
geom_smooth(method = "lm") +
facet_wrap( ~ as.factor(radius))
## Warning: Removed 184 rows containing non-finite values (stat_smooth).
## Warning: Removed 184 rows containing missing values (geom_point).
“Measures the randomness of a gray-level distribution”
nd_ent <- cbi %>%
select(starts_with("nd_ent"), cbi_over, id, RBR) %>%
gather(key = radius, value = heterogeneity, starts_with("nd_ent")) %>%
separate(col = radius, into = c("type", "vi", "radius")) %>%
tidyr::unite(het_type, type, vi, sep = "_")
ggplot(nd_ent, aes(x = heterogeneity)) +
geom_density() +
facet_wrap( ~ as.factor(radius))
## Warning: Removed 32 rows containing non-finite values (stat_density).
ggplot(nd_ent, aes(x = heterogeneity, y = RBR)) +
geom_point() +
geom_smooth(method = "lm") +
facet_wrap( ~ as.factor(radius))
## Warning: Removed 32 rows containing non-finite values (stat_smooth).
## Warning: Removed 32 rows containing missing values (geom_point).
“Homogeneity. IDM tells us about the smoothness of the image.”
nd_idm <- cbi %>%
select(starts_with("nd_idm"), cbi_over, id, RBR) %>%
gather(key = radius, value = homogeneity, starts_with("nd_idm")) %>%
separate(col = radius, into = c("type", "vi", "radius")) %>%
tidyr::unite(het_type, type, vi, sep = "_")
ggplot(nd_idm, aes(x = homogeneity)) +
geom_density() +
facet_wrap( ~ as.factor(radius))
## Warning: Removed 32 rows containing non-finite values (stat_density).
ggplot(nd_idm, aes(x = homogeneity, y = RBR)) +
geom_point() +
geom_smooth(method = "lm") +
facet_wrap( ~ as.factor(radius))
## Warning: Removed 32 rows containing non-finite values (stat_smooth).
## Warning: Removed 32 rows containing missing values (geom_point).
“Variance tells us how spread out the distribution of gray-levels is.”
nd_var <- cbi %>%
select(starts_with("nd_var"), cbi_over, id, RBR) %>%
gather(key = radius, value = heterogeneity, starts_with("nd_var")) %>%
separate(col = radius, into = c("type", "vi", "radius")) %>%
tidyr::unite(het_type, type, vi, sep = "_")
ggplot(nd_var, aes(x = heterogeneity)) +
geom_density() +
facet_wrap( ~ as.factor(radius))
## Warning: Removed 32 rows containing non-finite values (stat_density).
ggplot(nd_var, aes(x = heterogeneity, y = RBR)) +
geom_point() +
geom_smooth(method = "lm") +
facet_wrap( ~ as.factor(radius))
## Warning: Removed 32 rows containing non-finite values (stat_smooth).
## Warning: Removed 32 rows containing missing values (geom_point).
“ASM measures the number of repeated pairs”
nd_asm <- cbi %>%
select(starts_with("nd_asm"), cbi_over, id, RBR) %>%
gather(key = radius, value = heterogeneity, starts_with("nd_asm")) %>%
separate(col = radius, into = c("type", "vi", "radius")) %>%
tidyr::unite(het_type, type, vi, sep = "_")
ggplot(nd_asm, aes(x = heterogeneity)) +
geom_density() +
facet_wrap( ~ as.factor(radius))
## Warning: Removed 32 rows containing non-finite values (stat_density).
ggplot(nd_asm, aes(x = heterogeneity, y = RBR)) +
geom_point() +
geom_smooth(method = "lm") +
facet_wrap( ~ as.factor(radius))
## Warning: Removed 32 rows containing non-finite values (stat_smooth).
## Warning: Removed 32 rows containing missing values (geom_point).
“Measures the correlation between the two pixels in the pixel pair”
nd_corr <- cbi %>%
select(starts_with("nd_corr"), cbi_over, id, RBR) %>%
gather(key = radius, value = heterogeneity, starts_with("nd_corr")) %>%
separate(col = radius, into = c("type", "vi", "radius")) %>%
tidyr::unite(het_type, type, vi, sep = "_")
ggplot(nd_corr, aes(x = heterogeneity)) +
geom_density() +
facet_wrap( ~ as.factor(radius))
## Warning: Removed 32 rows containing non-finite values (stat_density).
ggplot(nd_corr, aes(x = heterogeneity, y = RBR)) +
geom_point() +
geom_smooth(method = "lm") +
facet_wrap( ~ as.factor(radius))
## Warning: Removed 32 rows containing non-finite values (stat_smooth).
## Warning: Removed 32 rows containing missing values (geom_point).
“Contrast measures the local contrast of an image”
nd_contrast <- cbi %>%
select(starts_with("nd_contrast"), cbi_over, id, RBR) %>%
gather(key = radius, value = heterogeneity, starts_with("nd_contrast")) %>%
separate(col = radius, into = c("type", "vi", "radius")) %>%
tidyr::unite(het_type, type, vi, sep = "_")
ggplot(nd_contrast, aes(x = heterogeneity)) +
geom_density() +
facet_wrap( ~ as.factor(radius))
## Warning: Removed 32 rows containing non-finite values (stat_density).
ggplot(nd_contrast, aes(x = heterogeneity, y = RBR)) +
geom_point() +
geom_smooth(method = "lm") +
facet_wrap( ~ as.factor(radius))
## Warning: Removed 32 rows containing non-finite values (stat_smooth).
## Warning: Removed 32 rows containing missing values (geom_point).
“sum average”
savg <- cbi %>%
select(starts_with("nd_savg"), cbi_over, id, RBR) %>%
gather(key = radius, value = heterogeneity, starts_with("nd_savg")) %>%
separate(col = radius, into = c("type", "vi", "radius")) %>%
tidyr::unite(het_type, type, vi, sep = "_")
ggplot(savg, aes(x = heterogeneity)) +
geom_density() +
facet_wrap( ~ as.factor(radius))
## Warning: Removed 32 rows containing non-finite values (stat_density).
ggplot(savg, aes(x = heterogeneity, y = RBR)) +
geom_point() +
geom_smooth(method = "lm") +
facet_wrap( ~ as.factor(radius))
## Warning: Removed 32 rows containing non-finite values (stat_smooth).
## Warning: Removed 32 rows containing missing values (geom_point).
“sum variance”
svar <- cbi %>%
select(starts_with("nd_svar"), cbi_over, id, RBR) %>%
gather(key = radius, value = heterogeneity, starts_with("nd_svar")) %>%
separate(col = radius, into = c("type", "vi", "radius")) %>%
tidyr::unite(het_type, type, vi, sep = "_")
ggplot(svar, aes(x = heterogeneity)) +
geom_density() +
facet_wrap( ~ as.factor(radius))
## Warning: Removed 32 rows containing non-finite values (stat_density).
ggplot(svar, aes(x = heterogeneity, y = RBR)) +
geom_point() +
geom_smooth(method = "lm") +
facet_wrap( ~ as.factor(radius))
## Warning: Removed 32 rows containing non-finite values (stat_smooth).
## Warning: Removed 32 rows containing missing values (geom_point).
“sum entropy”
sent <- cbi %>%
select(starts_with("nd_sent"), cbi_over, id, RBR) %>%
gather(key = radius, value = heterogeneity, starts_with("nd_sent")) %>%
separate(col = radius, into = c("type", "vi", "radius")) %>%
tidyr::unite(het_type, type, vi, sep = "_")
ggplot(sent, aes(x = heterogeneity)) +
geom_density() +
facet_wrap( ~ as.factor(radius))
## Warning: Removed 32 rows containing non-finite values (stat_density).
ggplot(sent, aes(x = heterogeneity, y = RBR)) +
geom_point() +
geom_smooth(method = "lm") +
facet_wrap( ~ as.factor(radius))
## Warning: Removed 32 rows containing non-finite values (stat_smooth).
## Warning: Removed 32 rows containing missing values (geom_point).
“difference variance”
dvar <- cbi %>%
select(starts_with("nd_dvar"), cbi_over, id, RBR) %>%
gather(key = radius, value = heterogeneity, starts_with("nd_dvar")) %>%
separate(col = radius, into = c("type", "vi", "radius")) %>%
tidyr::unite(het_type, type, vi, sep = "_")
ggplot(dvar, aes(x = heterogeneity)) +
geom_density() +
facet_wrap( ~ as.factor(radius))
## Warning: Removed 32 rows containing non-finite values (stat_density).
ggplot(dvar, aes(x = heterogeneity, y = RBR)) +
geom_point() +
geom_smooth(method = "lm") +
facet_wrap( ~ as.factor(radius))
## Warning: Removed 32 rows containing non-finite values (stat_smooth).
## Warning: Removed 32 rows containing missing values (geom_point).
“difference entropy”
dent <- cbi %>%
select(starts_with("nd_dent"), cbi_over, id, RBR) %>%
gather(key = radius, value = heterogeneity, starts_with("nd_dent")) %>%
separate(col = radius, into = c("type", "vi", "radius")) %>%
tidyr::unite(het_type, type, vi, sep = "_")
ggplot(dent, aes(x = heterogeneity)) +
geom_density() +
facet_wrap( ~ as.factor(radius))
## Warning: Removed 32 rows containing non-finite values (stat_density).
ggplot(dent, aes(x = heterogeneity, y = RBR)) +
geom_point() +
geom_smooth(method = "lm") +
facet_wrap( ~ as.factor(radius))
## Warning: Removed 32 rows containing non-finite values (stat_smooth).
## Warning: Removed 32 rows containing missing values (geom_point).
“Info. measure of corr. 1”
imcorr1 <- cbi %>%
select(starts_with("nd_imcorr1"), cbi_over, id, RBR) %>%
gather(key = radius, value = heterogeneity, starts_with("nd_imcorr1")) %>%
separate(col = radius, into = c("type", "vi", "radius")) %>%
tidyr::unite(het_type, type, vi, sep = "_")
ggplot(imcorr1, aes(x = heterogeneity)) +
geom_density() +
facet_wrap( ~ as.factor(radius))
## Warning: Removed 32 rows containing non-finite values (stat_density).
ggplot(imcorr1, aes(x = heterogeneity, y = RBR)) +
geom_point() +
geom_smooth(method = "lm") +
facet_wrap( ~ as.factor(radius))
## Warning: Removed 32 rows containing non-finite values (stat_smooth).
## Warning: Removed 32 rows containing missing values (geom_point).
“Info. measure of corr. 2”
imcorr2 <- cbi %>%
select(starts_with("nd_imcorr2"), cbi_over, id, RBR) %>%
gather(key = radius, value = heterogeneity, starts_with("nd_imcorr2")) %>%
separate(col = radius, into = c("type", "vi", "radius")) %>%
tidyr::unite(het_type, type, vi, sep = "_")
ggplot(imcorr2, aes(x = heterogeneity)) +
geom_density() +
facet_wrap( ~ as.factor(radius))
## Warning: Removed 32 rows containing non-finite values (stat_density).
ggplot(imcorr2, aes(x = heterogeneity, y = RBR)) +
geom_point() +
geom_smooth(method = "lm") +
facet_wrap( ~ as.factor(radius))
## Warning: Removed 32 rows containing non-finite values (stat_smooth).
## Warning: Removed 32 rows containing missing values (geom_point).
“dissimilarity”
nd_diss <- cbi %>%
select(starts_with("nd_diss"), cbi_over, id, RBR) %>%
gather(key = radius, value = heterogeneity, starts_with("nd_diss")) %>%
separate(col = radius, into = c("type", "vi", "radius")) %>%
tidyr::unite(het_type, type, vi, sep = "_")
ggplot(nd_diss, aes(x = heterogeneity)) +
geom_density() +
facet_wrap( ~ as.factor(radius))
## Warning: Removed 32 rows containing non-finite values (stat_density).
ggplot(nd_diss, aes(x = heterogeneity, y = RBR)) +
geom_point() +
geom_smooth(method = "lm") +
facet_wrap( ~ as.factor(radius))
## Warning: Removed 32 rows containing non-finite values (stat_smooth).
## Warning: Removed 32 rows containing missing values (geom_point).
“intertia”
nd_inertia <- cbi %>%
select(starts_with("nd_inertia"), cbi_over, id, RBR) %>%
gather(key = radius, value = heterogeneity, starts_with("nd_inertia")) %>%
separate(col = radius, into = c("type", "vi", "radius")) %>%
tidyr::unite(het_type, type, vi, sep = "_")
ggplot(nd_inertia, aes(x = heterogeneity)) +
geom_density() +
facet_wrap( ~ as.factor(radius))
## Warning: Removed 32 rows containing non-finite values (stat_density).
ggplot(nd_inertia, aes(x = heterogeneity, y = RBR)) +
geom_point() +
geom_smooth(method = "lm") +
facet_wrap( ~ as.factor(radius))
## Warning: Removed 32 rows containing non-finite values (stat_smooth).
## Warning: Removed 32 rows containing missing values (geom_point).
“cluster shade”
nd_shade <- cbi %>%
select(starts_with("nd_shade"), cbi_over, id, RBR) %>%
gather(key = radius, value = heterogeneity, starts_with("nd_shade")) %>%
separate(col = radius, into = c("type", "vi", "radius")) %>%
tidyr::unite(het_type, type, vi, sep = "_")
ggplot(nd_shade, aes(x = heterogeneity)) +
geom_density() +
facet_wrap( ~ as.factor(radius))
## Warning: Removed 32 rows containing non-finite values (stat_density).
ggplot(nd_shade, aes(x = heterogeneity, y = RBR)) +
geom_point() +
geom_smooth(method = "lm") +
facet_wrap( ~ as.factor(radius))
## Warning: Removed 32 rows containing non-finite values (stat_smooth).
## Warning: Removed 32 rows containing missing values (geom_point).
“cluster prominence”
nd_prom <- cbi %>%
select(starts_with("nd_prom"), cbi_over, id, RBR) %>%
gather(key = radius, value = heterogeneity, starts_with("nd_prom")) %>%
separate(col = radius, into = c("type", "vi", "radius")) %>%
tidyr::unite(het_type, type, vi, sep = "_")
ggplot(nd_prom, aes(x = heterogeneity)) +
geom_density() +
facet_wrap( ~ as.factor(radius))
## Warning: Removed 32 rows containing non-finite values (stat_density).
ggplot(nd_prom, aes(x = heterogeneity, y = RBR)) +
geom_point() +
geom_smooth(method = "lm") +
facet_wrap( ~ as.factor(radius))
## Warning: Removed 32 rows containing non-finite values (stat_smooth).
## Warning: Removed 32 rows containing missing values (geom_point).